const express = require('express');
const path = require('path');

function main() {
  const mainApp = express();
  mainApp.get('/Tunnel.js', (a, resp) => resp.sendFile(path.join(__dirname, 'public/Tunnel.js')));
  mainApp.use(express.static(path.join(__dirname, 'public/main')));
  mainApp.listen(8888, (err) => console.error(err));

  const subApp = express();
  subApp.get('/Tunnel.js', (a, resp) => resp.sendFile(path.join(__dirname, 'public/Tunnel.js')));
  subApp.use(express.static(path.join(__dirname, 'public/sub')));
  subApp.listen(9999, (err) => console.error(err));
}

main();